package com.bw.medical.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bw.common.utils.PageUtils;
import com.bw.common.utils.Query;

import com.bw.medical.dao.TbPatientDao;
import com.bw.medical.entity.TbPatientEntity;
import com.bw.medical.service.TbPatientService;


@Service("tbPatientService")
public class TbPatientServiceImpl extends ServiceImpl<TbPatientDao, TbPatientEntity> implements TbPatientService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<TbPatientEntity> page = this.page(
                new Query<TbPatientEntity>().getPage(params),
                new QueryWrapper<TbPatientEntity>().like("patienName", params.get("patienName").toString())
                        .eq("userId", (Integer)params.get("userId"))
        );

        return new PageUtils(page);
    }

}